c09cbd280fec789419daa2a6b4fa0531fc6d969b,bobas.businessobjectscommon/src/main/java/org/colorcoding/ibas/bobas/repository/BORepository4DbBatch.java,BORepository4DbBatch,mySave,#IBusinessObjectBase[]#,84

Before Change


					command.addBatch(adapter4Db.parseSqlInsert(bo));
					if (this.isPostTransaction())
						command.addBatch(adapter4Db.parseBOTransactionNotification(TransactionType.Add, bo));
				} else if (bo.isDeleted()) {
					// 删除对象
					command.addBatch(adapter4Db.parseSqlDelete(bo));
					if (this.isPostTransaction())
						command.addBatch(adapter4Db.parseBOTransactionNotification(TransactionType.Update, bo));
				} else {
					// 修改对象,先删除数�,�添加新的实例
					command.addBatch(adapter4Db.parseSqlDelete(bo));
					command.addBatch(adapter4Db.parseSqlInsert(bo));
					if (this.isPostTransaction())
						command.addBatch(adapter4Db.parseBOTransactionNotification(TransactionType.Delete, bo));
				}
				savedBOs.add(bo);
			}

After Change


			// 主键处�
			KeyValue[] keys = adapter4Db.parsePrimaryKeys(bos[0], command);
			int keyUsedCount = 0;// 主键使用的个数
			for (IBusinessObjectBase bo : bos) {
				if (bo == null)
					continue;
				if (!bo.isDirty())
					continue;
				if (bo.isNew()) {
					// 新建的对象
					// 设置主键
					adapter4Db.setPrimaryKeys(bo, keys);
					// 主键值增加
					for (KeyValue key : keys) {
						if (key.value instanceof Integer) {
							key.value = Integer.sum((int) key.value, 1);
						} else if (key.value instanceof Integer) {
							key.value = Long.sum((long) key.value, 1);
						}
					}
					keyUsedCount++;// 使用了主键
				}
				// 解�BO�存语�,并添加到批�命令
				for (ISqlQuery sqlQuery : this.parseSaveQueries(bo, recursion)) {
					command.addBatch(sqlQuery);
				}
				// 通知事务
				if (this.isPostTransaction()) {
					if (bo.isNew()) {
						// 新建对象
						command.addBatch(adapter4Db.parseBOTransactionNotification(TransactionType.Add, bo));
					} else if (bo.isDeleted()) {
						// 删除对象
						command.addBatch(adapter4Db.parseBOTransactionNotification(TransactionType.Delete, bo));
					} else {
						// 更新对象
						command.addBatch(adapter4Db.parseBOTransactionNotification(TransactionType.Update, bo));